Anyway enough of the history!!!
So I followed the The Spikes module and above you can see the results.
1: import maya.cmds as cmds
2: """This script prints some information and creates a spike ball"""
3:
4: def addSpikes(obj):
5: """This function add spikes to polygon objects."""
6: try: polycount = cmds.polyEvaluate(obj,face=True)
7: except: raise
8: for i in range(0, polycount):
9: face = '%s.f[%s]'%(obj,i)
10: cmds.polyExtrudeFacet(face,ltz=1,ch=0,kft=True)
11: cmds.polyExtrudeFacet(face,ltz=1,ch=0,ls=[0.1,0.1,0.1])
12: cmds.polySoftEdge(obj,a=180,ch=0)
13: cmds.select(obj)
14:
15: print ('module name: %s'%__name__)
16: print ('globals:')
17: for k in globals().keys(): print ('\t%s'%k)
18: addSpikes(cmds.polyPrimitive(ch=0)[0])
I am going to write few more things as a reference for myself that could have been written to book. cmds.polyExtrudeFacet(...) Extrude faces. Faces can be extruded separately or together, and manipulations can be performed either in world or object space. | |
Selectively makes edges soft or hard.
An edge will be made hard if the angle between two owning faces is sharper (larger) than the smoothing angle.
An edge will be made soft if the angle between two owning facets is flatter (smaller) than the smoothing angle.
cmds.polyPrimitive(...)
Create a polygon primitive
and why I have written this, because off-course its a part of my learning.